<section class="content-header">
  <!-- <h1>
        审计业务
    </h1> -->
  <ol class="breadcrumb">
    <li><a ui-sref="dashboard"><i class="fa fa-dashboard"></i>我的面板</a></li>
    <li><a ui-sref="audit">审计列表</a></li>
    <li class="active">详情</li>
  </ol>
</section>
<section class="content">
  <form class="form-horizontal view-form" id="audit_form">
    <div class="box box-danger collapsed-box">
      <div class="box-header with-border">
        <h3 class="box-title">客户信息</h3>
        <div class="box-tools">
          <div class="box-tools pull-right">
            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i>
            </button>
          </div>
        </div>
      </div>
      <div class="box-body">
        <div class="form-group">
          <label class="col-sm-2 control-label">档案号</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.code"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">订单类别</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.type"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">客户名称</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.customer_name"></span>
          </div>
        </div>
        <div class="form-group" ng-if="data.industry.length > 0">
          <label class="col-sm-2 control-label">所属行业</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.industry"></span>
          </div>
        </div>
        <div class="form-group" ng-if="data.province.length > 0">
          <label class="col-sm-2 control-label">所属省</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.province"></span>
          </div>
        </div>
        <div class="form-group" ng-if="data.city.length > 0">
          <label class="col-sm-2 control-label">所属市</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.city"></span>
          </div>
        </div>
        <div class="form-group" ng-if="data.county.length > 0">
          <label class="col-sm-2 control-label">所属县</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.county"></span>
          </div>
        </div>
        <div class="form-group" ng-if="data.customer_address.length > 0">
          <label class="col-sm-2 control-label">地址</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.customer_address"></span>
          </div>
        </div>
        <div class="form-group" ng-if="data.contact.length > 0">
          <label class="col-sm-2 control-label">联系人</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.contact"></span>
          </div>
        </div>
        <div class="form-group" ng-if="data.mobile.length > 0">
          <label class="col-sm-2 control-label">手机</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.mobile"></span>
          </div>
        </div>
        <div class="form-group" ng-if="data.tel.length > 0">
          <label class="col-sm-2 control-label">座机</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.tel"></span>
          </div>
        </div>
      </div>
    </div>
    <div class="box box-danger collapsed-box">
      <div class="box-header with-border">
        <h3 class="box-title">注册信息</h3>
        <div class="box-tools">
          <div class="box-tools pull-right">
            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i>
            </button>
          </div>
        </div>
      </div>
      <div class="box-body">
        <div class="form-group">
          <label class="col-sm-2 control-label">公司中文名称</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.name_cn"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">公司英文名称</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.name_en"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">公司成立日期</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="format(data.date_setup, 'YYYY-MM-DD')"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">公司注册地址</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.address"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">业务性质</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.business_nature"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">行业类别</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.industry"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">业务范围</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.business_area"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">贸易方式</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.trade_mode"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">有无子母公司</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="(data.has_parent==0) ? '否' : '是'"></span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-2 control-label">做账次数</label>
          <div class="col-sm-8">
            <span class="form-span" ng-bind="data.account_number"></span>
          </div>
        </div>
      </div>
    </div>
    <div class="box box-danger">
      <div class="box-header with-border">
        <h3 class="box-title">审计信息</h3>
        <div class="box-tools">
          <div class="box-tools pull-right">
            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
            </button>
          </div>
        </div>
      </div>
      <div class="box-body" style="padding:0px;">
        <div class="box audit-box collapsed-box">
          <div class="box-header">
            <h3 class="box-title">账期1</h3>
            <div class="box-tools box-expand">
              <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i>
              </button>
            </div>
            <div class="box-tools pull-right">
              <!-- <button type="button" class="btn btn-box-tool" ui-sref="audit_edit({id: id})" ng-if="data.status == 0 || data.review_status == 0" ui-sref-opts="{reload:true}">修改</button> -->
              <button type="button" class="btn btn-box-tool" ui-sref="audit_edit({id: id})" ui-sref-opts="{reload:true}">修改</button>
              <button type="button" class="btn btn-box-tool" ng-click="submitAudit()" ng-if="data.status == 0 || data.review_status == 0">提交审核</button>
              <button type="button" class="btn btn-primary" ng-click="reAudit()" ng-if="data.status >= 1 && userInfo.username=='admin'">反审核</button>
              <button type="button" class="btn btn-box-tool" ng-click="passAuditF()" ng-if="data.status==1 && opers.indexOf(3) > -1">财务审核通过</button>
              <button type="button" class="btn btn-box-tool" ng-click="refuseAudit()" ng-if="data.status==1 && opers.indexOf(3) > -1">财务审核驳回</button>
              <button type="button" class="btn btn-box-tool" ng-click="passAudit()" ng-if="data.status > 1 && data.status < 3 && opers.indexOf(4) > -1">提交审核通过</button>
              <button type="button" class="btn btn-box-tool" ng-click="refuseAudit()" ng-if="data.status > 1 && data.status < 3 && opers.indexOf(4) > -1">提交审核驳回</button>
              <button type="button" class="btn btn-box-tool" ng-click="progress('p')" ng-if="data.status >= 3">进度反馈</button>
              <button type="button" class="btn btn-box-tool" ui-sref="audit_timeline({masterid: data.id,id: data.id, name: 'audit', code: data.code, source: 'view'})"><span class="fa fa-clock-o"></span>日志</button>
              <a href="/print.html?m=audit&id={{id}}" class="btn btn-box-tool" target="_blank">打印</a>
              <span>状态: </span>
              <span class="tooltip-author" ng-if="data.status != 4" ng-bind="getOrderStatus() + ' | ' + getReviewStatus()" ng-attr-title="{{getTitle(data)}}" style="cursor: default;"></span>
              <span ng-if="data.status == 4" ng-bind="'已完成 | ' + format(data.date_finish, 'YYYY-MM-DD')"></span>
            </div>
          </div>
          <div class="box-body">
            <fieldset>
              <legend>基本信息:</legend>
              <div class="form-group">
                <label class="col-sm-2 control-label">账期</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="format(data.account_period, 'YYYY-MM-DD') + ' 至 ' + format(data.account_period2, 'YYYY-MM-DD')"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">年结日</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="getYearEnd(data.date_year_end)"></span>
                </div>
              </div>
              <!-- <div class="form-group">
                <label class="col-sm-2 control-label">营业额</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="data.turnover"></span>
                </div>
              </div> -->
              <div class="form-group">
                <label class="col-sm-2 control-label">银行入账金额</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="data.amount_bank"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">单据量</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="data.bill_number"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">会计准则</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="data.accounting_standard"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">做账费用</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="data.cost_accounting"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">成交日期</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="format(data.date_transaction, 'YYYY-MM-DD')"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">成交金额</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="data.amount_transaction"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">交易币别</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="data.currency"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">其他事项</label>
                <div class="col-sm-8">
                  <textarea style="background-color: #fff;" class="form-control" rows="3" name="description" ng-model="data.description" data-rule="length[~100];" readonly></textarea>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">注册进度</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="!!data.progress? (' ' + data.progress) : ' 无进度信息'"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">客户归属</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="data.salesman"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">订单归属</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="data.creator"></span>
                  <button type="button" class="btn btn-info" ng-if="userInfo.username=='admin'" ui-sref=".creator()" ui-sref-opts="{location:false}">修改</button>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">渠道商</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="data.trader_name"></span>
                </div>
              </div>

              <div class="form-group">
                <label class="col-sm-2 control-label">供应商</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="data.supplier_name"></span>
                </div>
              </div>

              <div class="form-group">
                <label class="col-sm-2 control-label">助理</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="data.assistant_name"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">会计</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="data.accountant_name"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">经理</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="data.manager_name"></span>
                </div>
              </div>
            </fieldset>
            <fieldset>
              <legend>收款信息:</legend>
              <table class="table table-hover">
                <tbody>
                  <tr>
                    <th style="width: 10px">#</th>
                    <th>付款人</th>
                    <th>收款银行</th>
                    <th>收款账号</th>
                    <th>收款金额</th>
                    <th>币别</th>
                    <th>汇率</th>
                    <th>收款方式</th>
                    <th>收款时间</th>
                    <th>附件</th>
                    <th>备注</th>
                    <th class="opt-col">操作</th>
                  </tr>
                  <tr ng-repeat="item in incomes.items">
                    <td ng-bind="($index+1)+'.'"></td>
                    <td ng-bind="item.payer"></td>
                    <td ng-bind="item.bank"></td>
                    <td ng-bind="item.account"></td>
                    <td ng-bind="item.amount"></td>
                    <td ng-bind="item.currency"></td>
                    <td ng-bind="item.rate"></td>
                    <td ng-bind="item.pay_way"></td>
                    <td ng-bind="format(item.date_pay, 'YYYY-MM-DD')"></td>
                    <td>
                      <a href="{{item.attachment_url}}" target="_blank" ng-if="item.attachment_url.length">
                        <img ng-src="{{item.attachment_url}}" width="22" height="22">
                      </a>
                    </td>
                    <td ng-bind="item.description"></td>
                    <td class="opt-col">
                      <a  ng-if="data.status == 0" class="fa fa-pencil orange" ui-sref=".income_edit({tid: {{item.id}}})" ui-sref-opts="{location:false}" title="修改"></a>
                      <a  ng-if="data.status == 0" href="javascript:;" class="fa fa-trash-o red" ng-click="deleteIncome(item)" title="删除"></a>
                      <a  href="/print.html?m=audit_line&id={{item.id}}" target="_blank">打印</a>
                    </td>
                  </tr>
                  <tr>
                    <td></td>
                    <td class="summary" colspan="2">
                      <div>
                        <span>本币: </span>
                        <span class="num">人民币</span>
                      </div>
                      <div>
                        <span>应收款: </span>
                        <span class="num receivable" ng-bind="incomes.amount"></span>
                      </div>
                      <div>
                        <span>已收款: </span>
                        <span class="num received" ng-bind="incomes.total"></span>
                      </div>
                      <div>
                        <span>未收款: </span>
                        <span class="num balance" ng-bind="incomes.balance"></span>
                      </div>
                    </td>
                    <td class="summary" colspan="2">
                    </td>
                    <td class="summary" colspan="7">
                    </td>
                  </tr>
                </tbody>
              </table>
              <div style="margin-left:10px;">
                <!-- <button type="button" class="btn btn-info" ui-sref=".income_add({source_name: 'audit', customer_id: data.customer_id})" ui-sref-opts="{location:false}" ng-attr-title="{{data.status > 0 ? '已经提交审核，不能再新增' : '新增收款记录'}}" ng-disabled="data.status > 0">新增</button> -->
                <button type="button" class="btn btn-info" ui-sref=".income_add({source_name: 'audit', customer_id: data.customer_id})" ui-sref-opts="{location:false}">新增</button>
                <button type="button" class="btn btn-info" ng-click="printReceipt('new')">新增收据</button>
                <button type="button" class="btn btn-info" ng-click="printReceipt('print')">打印收据</button>
              </div>
            </fieldset>
          </div>
        </div>

        <div class="box audit-box collapsed-box" ng-repeat="item in subs">
          <div class="box-header">
            <h3 class="box-title" ng-bind="'账期' + ($index+2)"></h3>
            <div class="box-tools box-expand">
              <button type="button" class="btn btn-box-tool" data-widget="collapse" ng-click="expandSub(item, $event)"><i class="fa fa-plus"></i>
              </button>
            </div>
            <div class="box-tools pull-right">
              <!-- <button type="button" class="btn btn-box-tool" ui-sref=".editsub({sub_id: item.id})"  ui-sref-opts="{location:false}" ng-if="item.status == 0 || item.review_status == 0">修改</button> -->
              <button type="button" class="btn btn-box-tool" ui-sref=".editsub({sub_id: item.id})"  ui-sref-opts="{location:false}">修改</button>
              <button type="button" class="btn btn-box-tool" ng-click="submitSubAudit(item.id)" ng-if="item.status == 0 || item.review_status == 0">提交审核</button>
              <button type="button" class="btn btn-primary" ng-click="reAuditSubAudit(item.id)" ng-if="item.status >= 1 && userInfo.username=='admin'">反审核</button>
              <button type="button" class="btn btn-box-tool" ng-click="passSubAuditF(item.id)" ng-if="item.status==1 && opers.indexOf(3) > -1">财务审核通过</button>
              <button type="button" class="btn btn-box-tool" ng-click="refuseSubAudit(item.id)" ng-if="item.status==1 && opers.indexOf(3) > -1">财务审核驳回</button>
              <button type="button" class="btn btn-box-tool" ng-click="passSubAudit(item.id)" ng-if="item.status > 1 && item.status < 3 && opers.indexOf(4) > -1">提交审核通过</button>
              <button type="button" class="btn btn-box-tool" ng-click="refuseSubAudit(item.id)" ng-if="item.status > 1 && item.status < 3 && opers.indexOf(4) > -1">提交审核驳回</button>
              <button type="button" class="btn btn-box-tool" ng-click="progressSub('p', item)" ng-if="item.status >= 3">进度反馈</button>
              <button type="button" class="btn btn-box-tool" ui-sref="audit_timeline({masterid: item.master_id, id: item.id, name: 'sub_audit', code: data.code, source: 'view'})"><span class="fa fa-clock-o"></span>日志</button>
              <a href="/print.html?m=sub_audit&id={{item.id}}" class="btn btn-box-tool" target="_blank">打印</a>
              <span>状态: </span>
              <span class="tooltip-author" ng-if="item.status != 4" ng-bind="getSubOrderStatus(item) + ' | ' + getSubReviewStatus(item)" ng-attr-title="{{getTitle(item)}}" style="cursor: default;"></span>
              <span ng-if="item.status == 4" ng-bind="'已完成 | ' + format(item.date_finish, 'YYYY-MM-DD')"></span>
            </div>
          </div>
          <div class="box-body">
            <fieldset>
              <legend>基本信息:</legend>
              <div class="form-group">
                <label class="col-sm-2 control-label">账期</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="format(item.account_period, 'YYYY-MM-DD') + ' 至 ' + format(item.account_period2, 'YYYY-MM-DD')"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">年结日</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="getYearEnd(item.date_year_end)"></span>
                </div>
              </div>
              <!-- <div class="form-group">
                <label class="col-sm-2 control-label">营业额</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="item.turnover"></span>
                </div>
              </div> -->
              <div class="form-group">
                <label class="col-sm-2 control-label">银行入账金额</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="item.amount_bank"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">单据量</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="item.bill_number"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">会计准则</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="item.accounting_standard"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">做账费用</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="item.cost_accounting"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">成交日期</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="format(item.date_transaction, 'YYYY-MM-DD')"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">成交金额</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="item.amount_transaction"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">交易币别</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="item.currency"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">其他事项</label>
                <div class="col-sm-8">
                  <textarea style="background-color: #fff;" class="form-control" rows="3" name="description" ng-model="item.description" data-rule="length[~100];" readonly></textarea>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">注册进度</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="!!item.progress? (' ' + item.progress) : ' 无进度信息'"></span>
                </div>
              </div>
              <!-- <div class="form-group">
                <label class="col-sm-2 control-label">业务员</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="item.salesman"></span>
                </div>
              </div> -->
              <div class="form-group">
                <label class="col-sm-2 control-label">客户归属</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="item.salesman"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">订单归属</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="item.creator"></span>
                  <button type="button" class="btn btn-info" ng-if="userInfo.username=='admin'" ui-sref=".creator()" ui-sref-opts="{location:false}">修改</button>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">渠道商</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="item.trader_name"></span>
                </div>
              </div>

              <div class="form-group">
                <label class="col-sm-2 control-label">供应商</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="item.supplier_name"></span>
                </div>
              </div>

              <div class="form-group">
                <label class="col-sm-2 control-label">助理</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="item.assistant_name"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">会计</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="item.accountant_name"></span>
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">经理</label>
                <div class="col-sm-8">
                  <span class="form-span" ng-bind="item.manager_name"></span>
                </div>
              </div>
            </fieldset>
            <fieldset>
              <legend>收款信息:</legend>
              <table class="table table-hover">
                <tbody>
                  <tr>
                    <th style="width: 10px">#</th>
                    <th>付款人</th>
                    <th>收款银行</th>
                    <th>收款账号</th>
                    <th>收款金额</th>
                    <th>币别</th>
                  <th>汇率</th>
                    <th>收款方式</th>
                    <th>收款时间</th>
                    <th>附件</th>
                    <th>备注</th>
                    <th class="opt-col">操作</th>
                  </tr>
                  <tr ng-repeat="income in item.incomes.items">
                    <td ng-bind="($index+1)+'.'"></td>
                    <td ng-bind="income.payer"></td>
                    <td ng-bind="income.bank"></td>
                    <td ng-bind="income.account"></td>
                    <td ng-bind="income.amount"></td>
                    <td ng-bind="item.currency"></td>
                    <td ng-bind="item.rate"></td>
                    <td ng-bind="income.pay_way"></td>
                    <td ng-bind="format(income.date_pay, 'YYYY-MM-DD')"></td>
                    <td>
                      <a href="{{income.attachment_url}}" target="_blank" ng-if="income.attachment_url.length">
                        <img ng-src="{{income.attachment_url}}" width="22" height="22">
                      </a>
                    </td>
                    <td ng-bind="income.description"></td>
                    <td class="opt-col">
                      <a ng-if="data.status == 0" class="fa fa-pencil orange" ui-sref=".income_edit({tid: {{income.id}}})" ui-sref-opts="{location:false}" title="修改"></a>
                      <a ng-if="data.status == 0" href="javascript:;" class="fa fa-trash-o red" ng-click="deleteIncome(income)" title="删除"></a>
                      <a  href="/print.html?m=sub_audit_line&id={{income.id}}" target="_blank">打印</a>
                    </td>
                  </tr>
                  <tr ng-if="item.incomes.items.length > 0">
                    <td></td>
                    <td class="summary" colspan="2">
                      <div>
                        <span>本币: </span>
                        <span class="num">人民币</span>
                      </div>
                      <div>
                        <span>应收款: </span>
                        <span class="num receivable" ng-bind="item.incomes.amount"></span>
                      </div>
                      <div>
                        <span>已收款: </span>
                        <span class="num received" ng-bind="item.incomes.total"></span>
                      </div>
                      <div>
                        <span>未收款: </span>
                        <span class="num balance" ng-bind="item.incomes.balance"></span>
                      </div>
                      <div ng-if="item.currency !='人民币'">
                        <span>汇率: </span>
                        <span class="num" ng-bind="item.rate"></span>
                      </div>
                    </td>
                    <td class="summary" colspan="2">
                    </td>
                    <td class="summary" colspan="7">
                    </td>
                  </tr>
                </tbody>
              </table>
              <div style="margin-left:10px;">
                <button type="button" class="btn btn-info" ui-sref=".income_add_sub({source_name: 'sub_audit', customer_id: item.customer_id, subId: item.id})" ui-sref-opts="{location:false}">新增</button>
                <button type="button" class="btn btn-info" ng-click="printReceiptSub('new', item)">新增收据</button>
                <button type="button" class="btn btn-info" ng-click="printReceiptSub('print', item)">打印收据</button>
              </div>
            </fieldset>
          </div>
        </div>
      </div>
      <div class="box-footer clearfix">
        <button type="button" class="btn btn-info" ng-disabled="getDisabled()" ui-sref=".addsub()" ui-sref-opts="{location:false}">新增账期</button>
      </div>
    </div>
    <div class="box box-danger collapsed-box">
      <div class="box-header with-border">
        <h3 class="box-title">开户行</h3>
        <div class="box-tools pull-right">
          <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i>
          </button>
        </div>
      </div>
      <div class="box-body table-responsive no-padding">
        <table class="table table-hover">
          <tbody>
            <tr>
              <th style="width: 10px">#</th>
              <th>开户行</th>
              <th>开户人</th>
              <th>银行账号</th>
              <th class="opt-col" ng-if="data.status == 0">操作</th>
            </tr>
            <tr ng-repeat="item in banks">
              <td ng-bind="($index+1)+'.'"></td>
              <td ng-bind="item.bank"></td>
              <td ng-bind="item.holder"></td>
              <td ng-bind="item.account"></td>
              <td class="opt-col" ng-if="data.status == 0">
                <a href="javascript:;" class="fa fa-trash-o red" ng-click="deleteBank(item)" title="移除"></a>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
      <div class="box-footer clearfix">
        <button type="button" class="btn btn-info" ui-sref=".bank_add({audit_id: data.id, customer_id: data.customer_id})" ui-sref-opts="{location:false}" ng-attr-title="{{data.status > 0 ? '已经提交审核，不能再新增' : '新增开户行'}}" ng-disabled="data.status > 0">新增开户行</button>
        <button type="button" class="btn btn-info" ui-sref=".bank_select({audit_id: data.id, customer_id: data.customer_id})" ui-sref-opts="{location:false}" ng-attr-title="{{data.status > 0 ? '已经提交审核，不能再新增' : '选择开户行'}}" ng-disabled="data.status > 0">选择已有开户行</button>
      </div>
    </div>
    <div class="box box-danger">
      <div class="box-header with-border">
        <h3 class="box-title">附件</h3>
        <div class="box-tools">
          <div class="box-tools pull-right">
            <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
            </button>
          </div>
        </div>
      </div>
      <div class="box-body table-responsive no-padding">
        <table class="table table-hover">
          <tbody>
            <tr>
              <th style="width: 10px">#</th>
              <th>名称</th>
              <th>附件</th>
              <th>上传时间</th>
              <th>备注</th>
              <th class="opt-col">操作</th>
            </tr>
            <tr ng-repeat="item in attachments">
              <td ng-bind="($index+1)+'.'"></td>
              <td ng-bind="item.name"></td>
              <td>
                <a href="{{item.attachment_url}}" target="_blank" ng-if="item.attachment_url.length">
                          点击查看
                      </a>
              </td>
              <td ng-bind="format(item.date_created, 'YYYY-MM-DD')"></td>
              <td ng-bind="item.description"></td>
              <td class="opt-col">
                <a href="javascript:;" class="fa fa-trash-o red" ng-click="deleteAttachment(item)" title="删除"></a>
              </td>
            </tr>
          </tbody>
        </table>
      </div>
      <div class="box-footer clearfix">
        <button type="button" class="btn btn-info" ui-sref=".attachment({source_name: 'audit', source_id: data.id})" ui-sref-opts="{location:false}">新增</button>
      </div>
    </div>
  </form>
</section>
<div ui-view="modal"></div>
<div ui-view="progress"></div>
<div ui-view="bank"></div>
<div ui-view="print"></div>
<div ui-view="sub"></div>
<div ui-view="attachment"></div>
